<tagLib name="html" />
<include file="Public:headerNew" />
<load href="__PUBLIC__/Js/jqueryUI/jquery-ui-1.8.16.custom.min.js" />
<load href="__PUBLIC__/Css/jqueryUI/jquery-ui-1.8.21.custom.css" />
<load href="__PUBLIC__/Js/Jquery/jquery.form.js" />
		<style type="text/css">
			/*demo page css*/

			.demoHeaders { margin-top: 2em; }
			#dialog_link {padding: .4em 1em .4em 0px;text-decoration: none;position: relative;}
		</style>
  <div id="dialog" title="缴费发票登记">
<table width="480" border="0" align="center" cellpadding="3" cellspacing="3" style="font-size:14px;">
		  <tr>
		    <td height="35">名称：</td>
		    <td colspan="3"><input name="bizid" type="hidden" value="{$com.id}" />{$com.name} </td>
    </tr>
		  <tr>
		    <td width="110" height="35">水电费发票号：</td>
		    <td width="198"><input name="pay_invo1" type="text" id="pay_num2" size="30" style="height:28px; border:#525252 1px solid;font-size:14px;color:#525252;font-family: Segoe UI,Microsoft Yahei,Tahoma,Arial,Helvetica,sans-serif;" /></td>
		    <td width="59" align="center"><input name="tranid" type="hidden" value="" />
	        金额:</td>
		    <td width="74" id="invo_num">&nbsp;</td>
	      </tr>
          <eq name="showP" value="1">
		  <tr id="cp_tr">
		    <td width="110" height="35">物业费发票号：</td>
		    <td width="198"><input name="pay_invo1" type="text" id="pay_num2" size="30" style="height:28px; border:#525252 1px solid;font-size:14px;color:#525252;font-family: Segoe UI,Microsoft Yahei,Tahoma,Arial,Helvetica,sans-serif;" /></td>
		    <td align="center"><input name="p_tran_id" type="hidden" value="" />
	        金额:</td>
		    <td id="invo_num_cp">&nbsp;</td>
	      </tr>
          </eq>
          <eq name="showH" value="1">
		  <tr id="ch_tr">
		    <td width="110" height="35">取暖费发票号：</td>
		    <td width="198"><input name="pay_invo1" type="text" id="pay_num2" size="30" style="height:28px; border:#525252 1px solid;font-size:14px;color:#525252;font-family: Segoe UI,Microsoft Yahei,Tahoma,Arial,Helvetica,sans-serif;" /></td>
		    <td align="center"><input name="h_tran_id" type="hidden" value="" />
	        金额:</td>
		    <td id="invo_num_ch">&nbsp;</td>
	      </tr>
          </eq>
		  </table>
		</div>      
        
  <form method='post' id="form1" name="form1" action="__URL__/insertTran"  enctype="multipart/form-data">
<div class="titleone"><h1 class="fLeft" id="test">缴费管理</h1><a href="__URL__/comlist/zoneid/{$com.zoneid}"><div class="returnimg"></div></a></div>
<div id="result" class="result none"></div>
<!-- ui-dialog -->
		

	<script type="text/javascript">
			$(function(){
				var wSize = getPageSize();
				reWindows();
				<eq name="showP" value="1"> 
                pPnum();
				</eq>
				<eq name="showH" value="1">
				hPnum();
				</eq>
                 //输入数字
	
                $("#pay_num").keyup(function(){
                	var a = $("#pay_num").val();
                    var b = Number($("#r_pay").html());
               		if(($.isNumeric(a))&&(a>=b)){   
                    	$("#other_pay").html(Number(accSubtr(Number(a),b)).toFixed(1));
                    
                    }else{
						$("#other_pay").html("0.0");
					}
  						
				});
                
                
                
				
					$(window).resize(function(){  
						reWindows(); 
					}); 
					
	       		$('#form1').ajaxForm({
						type: 'POST',
									
						beforeSubmit:  checkForm,  // pre-submit callback
						
						success:       complete,  // post-submit callback
						
						dataType: 'json'
				
				});
					
		
		        
				function checkForm(){

							if( '' == $.trim($('#pay_num').val())){
											
									$('#result').html('金额不能为空').show();
							
											return false;
							
							}
							

				$("#background",window.parent.parent.document).show();
				$("#progressBar",window.parent.parent.document).show(); 
							

								
							//可以在此添加其它判断
		
						}
							
				function complete(data){
								
								$("#progressBar",window.parent.parent.document).hide(); 
						
							if (data.status==1){
										$("#succmsg",window.parent.parent.document).html(data.info).fadeIn(600); 
										setTimeout(function(){ $("#succmsg",window.parent.parent.document).fadeOut(600,function(){ $("#background",window.parent.parent.document).hide();
									$('#dialog').dialog('open');});},2000);
										//$('#result').html(data.info).show();
						
										// 更新列表
										data = data.data;
										//赋值给3个id号
						
									}else{
						
										$('#result').html(data.info).show();
						
									}
									//$("#background",window.parent.parent.document).hide();
									//$('#dialog').dialog('open');
									return false;
			 } 
			
			// Dialog			
				$('#dialog').dialog({
					autoOpen: false,
					width: 550,
	
					modal: true,
					buttons: {
						" 更 新 ": function() { 

								//$(this).dialog("close"); 
						} ,
						" 取 消 ": function() { 

								//$(this).dialog("close"); 
						} 
						
					}
				});
				
				// Dialog Link
				$('#test').click(function(){
					//累计收费分位全进位
					$('#dialog').dialog('open');
					return false;
				});
								//hover states on the static widgets
				
				function reWindows(){
					$(".thumbr").attr("width",wSize[0]-300-268);
					$(".newTb").attr("width",wSize[0]-300-180);
					$(".pt_left").attr("width",wSize[0]-290);
					
				}

                

			});
            
			function submitForm() { 
									// inside event callbacks 'this' is the DOM element so we first 
									// wrap it in a jQuery object and then invoke ajaxSubmit 
				$("#pay_list").val($("#record-frame").contents().find("#ap_list").val());

						

						$("#pay_cost").val(Number($("#r_pay").html()));   //实际费用，小数点后2位 应收
						$("#pay_cost1").val(Number($("#r_pay").html()).toFixed(1));  //收到费用，小数点后1位 实收
						$("#form1").submit();
       					return false;	
								
   			};

			//计算物业费用
	

    function IFrameReSize(iframename) { 
        var pTar = document.getElementById(iframename); 
        if (pTar) {  //ff
            if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) { 
                pTar.height = pTar.contentDocument.body.offsetHeight; 
            } //ie
            else if (pTar.Document && pTar.Document.body.scrollHeight) { 
                pTar.height = pTar.Document.body.scrollHeight; 
            } 
       } 

}
//iframe宽度自适应

    function IFrameReSizeWidth(iframename) { 
        var pTar = document.getElementById(iframename); 
        if (pTar) {  //ff
            if (pTar.contentDocument && pTar.contentDocument.body.offsetWidth) { 
                pTar.width = pTar.contentDocument.body.offsetWidth-110; 
            }  //ie
            else if (pTar.Document && pTar.Document.body.scrollWidth) { 
                pTar.width = pTar.Document.body.scrollWidth-130; 
            } 
       } 
    }

			
			
			
</script>
		

<div id="main" class="main full" style="height:100%" >
  <div class="metroTitle">缴费管理</div>

<table width="100%" border="0" cellspacing="3" cellpadding="3" style="margin:8px 8px 8px 0px; padding:8px; background-color:#EBEAEA; font-size:14px; line-height:150%;color:#525252;">
  <tr>
    <td width="22%">名称：<input name="bizsid" type="hidden" value="{$com.bizSid}" /><input name="bizid" type="hidden" value="{$com.id}" /><input name="pay_list" id="pay_list" type="hidden" value="0" />{$com.name} [{$com.bizSid}]<input type="hidden" name="resid" value="{$com.resid}" /></td>
    <td width="8%">&nbsp;</td>
    <td width="10%">&nbsp;</td>
    <td width="60%">&nbsp;</td>
    <td width="60%">&nbsp;</td>
  </tr>
  <tr>
    <td>联系人:</td>
    <td>&nbsp;</td>
    <td>联系电话:</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </table>
<ul id="pn_list" class="pn_list">
<li style="height:220px;">
<div class="thumb">
<img src="__PUBLIC__/images/icons/r_list.png" width="100" height="100"/>
</div>
<div class="thumbr">
<iframe id="record-frame"  name="record-frame" src="__URL__/recordlist/bizid/{$com.id}" width="100%" height="220" scrolling="no" frameborder="0" onload="IFrameReSizeWidth('record-frame');"></iframe>
</div>
</li>

<li>
<div class="thumb">
<img src="__PUBLIC__/images/icons/other_icon.png" width="100" height="100"/>
</div>

<div class="thumbr">
  <table class="newTb" width="100%" border="0" cellpadding="0" cellspacing="0" style="font-size:14px;color:#525252; margin:2px 2px; padding:4px 4px;">
    <tr height="35" style="background-color:#f6f6f6">
      <th width="8%" align="left" style="border-left:#3399ff 6px solid;padding-left:4px;"> 
        选择</th>
      <th width="15%" align="left">名称</th>
      <th width="15%" align="left">月数/年</th>
      <th width="15%" align="left">面积</th>
      <th width="15%" align="left">单价</th>
      <th width="20%" align="left">总金额</th>
      <th width="20%" align="left">到期月</th>
    </tr>
    <eq name="showP" value="1">

    <tr height="35">
      <td align="left" style="border-bottom:#ececec 1px solid;"><input type="checkbox" name="cp" id="cp" value="1" checked="checked" onclick="selectOption('cp')" /></td>
      <td align="left" height="35" style="border-bottom:#ececec 1px solid;">物业费
        
        <input id="p_anum" name="p_anum" type="hidden" vaule="0"/>
        <input id="p_anum1" name="p_anum1" type="hidden" vaule="0"/></td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="p_mon">{$p_mon}</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="p_znum">{$com.znum}</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="p_price">{$com.p_price}</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="cp_pp">&nbsp;</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="pdate">{$com.p_update}</td>
    </tr>

        
</eq>    
<eq name="showH" value="1">
    <tr height="35">
      <td align="left" style="border-bottom:#ececec 1px solid;"><input name="ch" type="checkbox" id="ch" onclick="selectOption('ch')" value="1" checked="checked" /></td>
      <td align="left" height="35" style="border-bottom:#ececec 1px solid;">采暖费
        <input id="h_anum" name="h_anum" type="hidden" vaule="0"/>
        <input id="h_anum1" name="h_anum1" type="hidden" vaule="0"/></td>
      <td align="left" style="border-bottom:#ececec 1px solid;">4</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="h_znum">{$com.znum2}</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="h_price">{$com.h_price}</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="ch_pp">&nbsp;</td>
      <td align="left" style="border-bottom:#ececec 1px solid;" id="hdate">{$com.h_update}</td>
    </tr>
   </eq>  
  </table>

</div>

</li>
</ul>
<div class="pay_panel fLeft">
<p>
<table width="900" height="90" border="0" cellspacing="6" cellpadding="4" style="margin:8px 8px 0px 8px; padding:0px;font-size:14px; line-height:150%;color:#525252;">
  <tr>
    <td width="70" height="35" style="border-left:#F00 6px solid; padding-left:6px;">&nbsp;&nbsp;应缴费：<input name="pay_cost" id="pay_cost" type="hidden" value="0" /><input name="pay_cost1" id="pay_cost1" type="hidden" value="0" /></td>
    <td width="145" id="r_pay">0.00</td>
    <td width="70">实缴费：</td>
    <td width="202" ><input name="pay_num" type="text" id="pay_num" size="20" style="height:28px; border:#525252 1px solid;font-size:14px;color:#525252;font-family: Segoe UI,Microsoft Yahei,Tahoma,Arial,Helvetica,sans-serif;" /></td>
    <td width="149" rowspan="2" valign="top" ><div id="pay_now" class="pay_now"><a href="javascript:void(0)" style="width:120px;height:48px; display:block;" onclick="submitForm();"></a></div></td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="35" style="border-left:#F00 6px solid; padding-left:6px;">&nbsp;&nbsp;找零：</td>
    <td id="other_pay">0.0</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </table>

</p>
</div>
</div>
</form>

<script language="javascript">
<eq name="showP" value="1">
		function pPnum(){
            	var nu=accMul(accMul(Number($("#p_znum").html()),Number($("#p_price").html())),Number($("#p_mon").html()));
     
			
                var nu1=nu.toFixed(2);
				//实际金额
                $("#p_anum").val(nu);
				$("#p_anum1").val(nu1);
                $("#cp_pp").html(nu1);
                $("#invo_num_cp").html(nu1);
			  	$("#r_pay").html(accAdd(Number(nu1),Number($("#r_pay").html()))); 
            
            }
        
		 </eq>
<eq name="showH" value="1">
		function hPnum(){
            	var nu=accMul(Number($("#h_znum").html()),Number($("#h_price").html()));
     
			
                var nu1=nu.toFixed(2);
				//实际金额
                $("#h_anum").val(nu);
				$("#h_anum1").val(nu1);
                 $("#ch_pp").html(nu1);
 				$("#invo_num_ch").html(nu1);
				 $("#r_pay").html(accAdd(Number(nu1),Number($("#r_pay").html()))); 
            
            }
        
		 </eq>		 
		<if condition="($showP eq 1) OR ($showH eq 1) "> 
		function selectOption(terget){

                if($("#"+terget).is(":checked")){
                	$("#"+terget).attr("checked",true);
                 	$("#"+terget+"_tr").removeAttr("style");
					$("#invo_num_"+terget).html($("#"+terget+"_pp").html());
                    $("#r_pay").html(accAdd(Number($("#r_pay").html()),Number($("#"+terget+"_pp").html())));
					
                   
                }else{
                    $("#"+terget).removeAttr("checked");
					$("#"+terget+"_tr").css("display","none");
					$("#invo_num_"+terget).html("0.00");
                    $("#r_pay").html(accSubtr(Number($("#r_pay").html()),Number($("#"+terget+"_pp").html())));
                }
				
			}
			</if>
        </script>
       
</body></html>






		


